package com.maimao.cart.client;

import com.maimao.cart.client.factory.CouponFallBackFactory;
import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.info.MgCoupon;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@RequestMapping("/info/coupon")
@FeignClient(contextId = "couponClient", value = ServiceContainer.INFO_SERVICE, fallbackFactory = CouponFallBackFactory.class, configuration = FeignInterceptor.class)
public interface CouponClient {

    /**
     * 店铺的所有可用优惠券(店铺优惠券和商品优惠券)
     *
     * @param shopId 店铺id
     * @return
     */
    @GetMapping("/shop-coupons/all")
    Result<List<MgCoupon>> queryCouponsByShop(@RequestParam("shopId") Long shopId);
}
